package com.gitee.ywj1352.jdk8;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

/**
 * @author wenjie.yang
 * @date 2/24/2020 7:26 PM
 */
public class FileIoDemo {

    public static void main(String[] args) throws IOException {
        FileInputStream is = new FileInputStream("C:\\Users\\wenjie.yang\\Desktop\\项目\\msd\\pdf\\demo.txt");
        FileOutputStream os = new FileOutputStream("C:\\Users\\wenjie.yang\\Desktop\\项目\\msd\\pdf\\demo2.txt");
        byte[] bytes = new byte[1024];
        int len = 0;
        while((len = is.read(bytes))!= -1){
            String s = new String(bytes,"GBK");
            os.write(bytes);
            System.out.println(s);
        }
        is.close();
        os.close();
    }

}
